﻿using System;
using System.Collections.Generic;
using System.Linq;
using SAPbobsCOM;
using System.Text;

namespace CompanySyncProject
{
    class DIGoodsReceipt : BaseRun
    {
        public DIGoodsReceipt(Company co, System.IO.StreamWriter lo)
            : base(co, lo)
        {

        }

        public override void Run()
        {
            oCompany.XmlExportType = BoXmlExportTypes.xet_ExportImportMode;
            /*
            SAPbobsCOM.Documents oReceipt = oCompany.GetBusinessObject(BoObjectTypes.oInventoryGenEntry);
            oReceipt.Lines.ItemCode = "I001";
            oReceipt.Lines.Quantity = 1;
            oReceipt.Lines.Price = 200;
            oReceipt.SaveToFile("c:\\temp\\receipt.txt");
            //oReceipt.Add();
            */

            SAPbobsCOM.Documents oReceipt = oCompany.GetBusinessObjectFromXML("c:\\temp\\doc.txt", 0);
            oReceipt.Add();

            int ret = 0;
            string msg;
            oCompany.GetLastError(out ret, out msg);
            System.Console.WriteLine(msg);

            string newkey = oCompany.GetNewObjectKey();

        }
    }
}
